<!DOCTYPE html>
<html lang="en">
	<head>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<meta http-equiv="Access-Control-Allow-Origin" content="*">
		<meta charset="UTF-8">
		<title>提现</title>
		<link rel="stylesheet" type="text/css" href="__STATIC__/home/css/reset.css">
		<script src="__STATIC__/home/js/base.js"></script>
		<link rel="stylesheet" href="__STATIC__/home/css/mycz.css">
	</head>
<body>
	<div class="container">
		<a href="mycz.html" class="">充值</a>
		<a href="javascript:;" class="active">提现</a>
	</div>
	<!-- 提现 -->
	<div class="cz tx">
		<form action="" method="post" id="formdata">
			<ul>
				<li>
					<span>用户名</span>
					<p>{$user['name']}</p>
				</li>
				<li>
					<span>账号余额</span>
					<p id="money">{$user['money']}</p>
				</li>
				<li>
					<span>提现金额</span>
					<input type="number" name="money">
				</li>
				<li>
					<span>提款类型</span>
					<select name="type" id="lx2">
						<option value="1">支付宝</option>
						<option value="2">微信</option>
						<option value="3" selected>银行卡</option>
					</select>
				</li>
				<li>
					<span>账号</span>
					<input type="number" name="number" id="zhanghao">
				</li>
				<li>
			</ul>
			<button class="btn">提现申请</button>
		</form>
	</div>
</body>
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
<script type="text/javascript">
$(".btn").click(function(){
	var bool=true;
	var moneyInput;
	$('input').each(function(i){
		if(i==1){
			moneyInput = $(this);
		}
		if(!$(this).val()) bool=false;
	})
	if(bool){
		if(moneyInput.val() > $("#money").text()){
			alert("余额不足"+moneyInput.val()."!");
			moneyInput.val("");
		}else if(moneyInput.val() <= 0){
			alert("请填写正确的金额!");
			moneyInput.val("");
		}else{
			$("#formdata").submit();
		}
	}else{
		alert("请将数据填写完整！");
	}
})
</script>
</html>